package cubelabs.nexus.dao;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import cubelabs.nexus.entity.User;

@Repository("userDAO")
public class UserDAO extends BaseDAO<User, Long>{

	
	public User findByEmail(String email){
		Criteria crit = getSession().createCriteria(getPersistentClass());
		crit.add(Restrictions.eq("email", email));
		User user  = (User) crit.uniqueResult();
		return user;
	}
	
}
